
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="format-detection" content="telephone=no,email=no"/>
<link rel="shortcut icon" href="${root}favicon.ico"/>
    <meta name="keywords" content="腾讯课堂,QQ群视频教育,免费课,腾讯在线教育,腾讯教育,腾讯在线课堂,QQ在线教育,QQ教育,公开课,在线学习">
    <meta name="description" content="腾讯推出的专业在线教育平台。依托QQ群视频和腾讯视频直播能力，实现老师在线上课教学，学生即时互动学习的课堂。下设职业培训、公务员考试、托福雅思、考证考级、英语口语、中小学教育等众多分类课程。">
    <title>分销课程</title>
    
    <link rel="stylesheet" href='${root}css/common.css' />
    <link rel="stylesheet" href='${root}css/sale/index.css' />
    <link rel="stylesheet" href='${root}assets/layui/css/layui.css' />
    <script>
var isMobile = /Android|iPhone|iPod|BlackBerry|IEMobile/i.test(navigator.userAgent);
    if (isMobile) {
        window.location.href = '//m.ke.qq.com/distributionCenter.html?_bid=167&_wv=1027';
    }
    </script>

    
</head>

<body class="l-media">
    <!--包含头部进来-->
	<!--:include("/inc/course/header.html"){}  -->


    <section id="sale-main" class="sale-main">
        <h1>分销课程 <i class="icon-font i-question js-sale-question"></i></h1>

        <div class="sale-description js-sale-description">
            <a href="javascript:;" class="icon-font i-close" style="display: none;"></a>
            <span class="icon-font i-v-top"></span>

            <p>分销规则：点击“我要分销”生成专属链接。把课程专属链接分享给其他人（QQ/微信/微博），他人购买后您可获得相应的提成。提成的金额由机构根据课程金额设置。</p>
            <p>提成获取：可在分销记录查看收益明细。收益达到500元即可提现。</p>
            <p>了解更多请查看 <a href="http://support.ke.qq.com/forum.php?mod=viewthread&tid=1306" target="_blank" report-tdw="action=click&obj1=rule">详细规则</a></p>
        </div>

        <div class="sale-content js-sale-content">
            <ul class="sale-tab-ul">
                <li class="sale-tab-li sale-tab-li--active"><a href="javascript:;">选择课程</a></li>
                <li class="sale-tab-li"><a href="javascript:;">分销记录</a></li>
            </ul>

            <div class="sale-tab-content sale-tab-content--active">
                <div class="js-sale-grid js-sale-course-grid" data-type="course">
                <div id="js-sale-course-table" class="grid-wrap ">
						<table cellpadding="0" cellspacing="0" class="grid-header-bg">
							<thead>
								<tr>
									<th class="grid-header-1 " style="width: 360px"><span>课程</span></th>
									<th class="grid-header-2 js-catalog-select catalog-select"
										style="width: 216px"><span>所属分类</span><i
										class="icon-font i-v-bottom"></i><span
										class="js-catalog-options catalog-options"> <a
											class="js-catalog-option" href="javascript:;"
											report-tdw="action=click&amp;obj1=filter_distribution"
											data-id="0">全部</a> 
											<!--:for(c in cache.cates!){  -->
											<a class="js-catalog-option"
											href="javascript:;"
											report-tdw="action=click&amp;obj1=filter_distribution"
											data-id="1001">${c.name!}</a>
											<!--:}  -->
											 </span></th>
									<th class="grid-header-3 " style="width: 156px"><span>课程价格<span
											class="icon-sort-top"></span><span class="icon-sort-bottom"></span></span></th>
									<th class="grid-header-4 " style="width: 156px"><span>提成比例<span
											class="icon-sort-top"></span><span class="icon-sort-bottom"></span></span></th>
									<th class="grid-header-5 " style="width: 156px"><span>成功分销<span
											class="icon-sort-top"></span><span class="icon-sort-bottom"></span></span></th>
									<th class="grid-header-6 " style="width: 156px"><span>操作</span></th>
								</tr>
							</thead>
						</table>
						<div class="grid-data-wrap">
							<table cellpadding="0" cellspacing="0" class="grid-data">
								<tbody>
									<!--:for(c in obj.list!){  -->
									<tr class="grid-row-${cLP.index}">
										<td class="grid-col-1" style="width: 360px;"><img
											class="course-cover"
											src="${www}${c.img!}"
											alt="课程(包)封面" width="90" height="51">
											<div class="course-info">
												<a class="course-name"
													target="_blank" title="${c.title!}"
													href="${root}course/${c.id!}">${c.title!}</a> 
													<a class="course-agency"
													target="_blank" title="${c.agency_name!}" href="//2ds.ke.qq.com">${c.agency_name!}</a>
											</div></td>
										<td class="grid-col-2" style="width: 216px;">${c.cate1!}</td>
										<td class="grid-col-3" style="width: 156px;">￥${c.price,"#.##"}</td>
										<td class="grid-col-4" style="width: 156px;">${c.divide/(session.user.organ_id>0?1:2)}%<br>
											<span class="rate-wording">即￥${c.price/100*c.divide/(session.user.organ_id>0?1:2),"#.##"}/单</span>
										</td>
										<td class="grid-col-5" style="width: 156px;">0人</td>
										<td class="grid-col-6" style="width: 156px;">
											<button class="btn btn-s btn-default js-btn-sale"
												data-id="${c.id}" data-type="course" data-name="${c.title!}"
												data-rate="5">我要分销</button>
										</td>
									</tr>
									<!--:}  -->
								</tbody>
							</table>
							<div class="loading-wrap"></div>
						</div>
						<div class="grid-page-wrap sort-page">
							<div class="page-box" id="sort-page">
								
							</div>
						</div>
					</div>
                </div>
            </div>
            <div class="sale-tab-content">
                <div class="sale-history">
                    <span class="sale-profit">历史收益：<strong class="js-profit">￥0.00</strong></span>
                    <span class="sale-surplus">可提现：<strong class="js-surplus">￥0.00</strong></span>
                    <button class="btn btn-m btn-default js-btn-withdraw btn-disabled">申请提现</button>
                </div>
                <div class="js-sale-grid js-sale-record-grid" data-type="record">
					
				</div>
            </div>
        </div>
    </section>

    <!--包含尾部进来-->
    <!--:include("/inc/footer.html"){}  -->
    <div tabindex="-1" class="overlay js-modal-bg hide"></div>
	<div class="js-modal modal "
		style="width: 580px; margin-top: -175px; margin-left: -290px; display: none;">
		<div class="modal-hd">
			<h3 class="hd-tt js-modal-title">提示</h3>
			<a href="javascript:void(0);" class="js-modal-close btn-close"
				title="关闭">×</a>
		</div>
		<div class="sale-url-wrapper">
			<h3>通过以下途径转发</h3>
			<div class="url-card-wrapper">
				<div class="url-card">
					<p class="url-card-tt">电脑端</p>
					<div class="url-card-info">
						<input type="text" class="url-string" id="course_url"
							value="">
						<button class="btn btn-m btn-default js-copy-url">复制</button>
						<p class="js-copy-tip gray-wordings"></p>
					</div>
				</div>
				<div class="url-card">
					<p class="url-card-tt">手机端</p>
					<div class="url-card-info url-card-info--qrcode">
						<div id="js-url-qrcode" class="url-qrcode" style="height: 100px;width: 100px;">
						</div>
						<p class="qrcode-tip">
							使用微信扫码<br> <span class="gray-wordings">QQ扫码帐号会被切换</span>
						</p>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<div class="jq-message-wrapper" style="display: none;"> <div class="jq-message jq-message--top"> <i class="icon-font i-success"></i><span class="js-msg-txt">复制成功</span> </div></div>
	<script src="${root}assets/layui/layui.js" charset="utf-8"></script>
	<script src="${root}js/url.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
layui.use(['laypage', 'layer'], function(){
  var laypage = layui.laypage
  ,layer = layui.layer;
  laypage({
	    cont: 'sort-page'
	    ,curr:${obj.pager.pageNumber}
	    ,pages:${obj.pager.pageCount}
	    ,jump: function(obj, first){
	      if(!first){
	        layer.msg('第 '+ obj.curr +' 页');
	        location.href=applyUrl("pageNumber",obj.curr)
	      }
	    }
	  });
})
</script>
<script type="text/javascript" src="${root}assets/js/qrcode.js" ></script>
<script src="${root}js/clipboard.min.js"></script>


<script type="text/javascript">
var uid=${session.user.id!0};
$(function(){
	
	$(".js-modal-close").click(function(){
		$(".js-modal-bg").addClass("hide")
		$(".js-modal").css("display","none")
	})
	$(".js-btn-sale").click(function(){
		if(uid==0){
			alert("你尚未登录，只有登录后才能成功分销!");
			return;
		}
		$("#course_url").val("${www}"+$(this).attr("data-type")+"/"+$(this).attr("data-id")+"?uid="+uid)
		$("#js-url-qrcode").empty()
		new QRCode(document.getElementById("js-url-qrcode"),{width:100,height:100,text:"${www}"+$(this).attr("data-type")+"/"+$(this).attr("data-id")+"?uid=${session.user.id!1}"} );
		$(".js-modal-bg").removeClass("hide")
		$(".js-modal").css("display","block")
		
	})
	
	$(".js-copy-url").click(function(){
		//copyTo($("#course_url").val());
		 $(".jq-message-wrapper").show().delay(2000).hide(300);
	})
})
    var clipboard = new Clipboard('.js-copy-url', {
        text: function() {
            return document.getElementById("course_url").value;
        }
    });
    clipboard.on('success', function(e) {
        console.log(e);
    });
    clipboard.on('error', function(e) {
        console.log(e);
    });
</script>
</body>

</html>